package com.hodge.web.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * 角色信息(Role)表实体类
 *
 * @author haojun
 * @since 2020-08-28 20:18:08
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@TableName(value = "tab_role", autoResultMap = true)
public class TabRole extends Model<TabRole> {
    //主键
    private Long id;

    //角色名称
    private String name;

    //角色标识
    private String code;

    //角色权限
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> permissions;

    //叶子节点，搭配 ElementUI tree 使用
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> leaves;

    //乐观锁
    @Version
    private Long version;

    //逻辑删除
    @TableField(select = false)
    private Boolean deleted;
}